<template>
  <div>
    <el-dialog
      v-model="dialogFormVisible"
      title="教育经历和求职期望"
      width="500"
    >
      <el-tabs
        class="tab-container"
        v-model="activeName"
        type="border-card"
        @tab-click="handleClick"
      >
        <el-tab-pane label="教育经历" name="third">
          <el-form
            :model="educationFormData"
            ref="educationForm"
            label-position="top"
          >
            <el-form-item label="学校名称" prop="educationExperience">
              <el-input
                v-model="educationFormData.school_name"
                placeholder="请输入学校名称"
              ></el-input>
            </el-form-item>
            <el-form-item label="学制类型" prop="type">
              <el-radio-group v-model="educationFormData.type">
                <el-radio :label="1">全日制</el-radio>
                <el-radio :label="2">非全日制</el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="学历" prop="education">
              <el-select
                v-model="educationFormData.eduction"
                placeholder="请选择学历"
              >
                <el-option label="高中及以下" :value="1"></el-option>
                <el-option label="大专" :value="2"></el-option>
                <el-option label="本科" :value="3"></el-option>
                <el-option label="硕士" :value="4"></el-option>
                <el-option label="博士" :value="5"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="专业" prop="major">
              <el-input
                v-model="educationFormData.major"
                placeholder="请输入专业"
              ></el-input>
            </el-form-item>
            <el-form-item label="入学年份" prop="enrollmentYear">
              <el-input
                v-model="educationFormData.enrollment_year"
                placeholder="请填写入学年份"
              ></el-input>
            </el-form-item>
            <el-form-item label="毕业年份" prop="graduationYear">
              <el-input
                v-model="educationFormData.graduation_year"
                placeholder="请填写毕业年份"
              ></el-input>
            </el-form-item>
            <el-form-item label="在校经历" prop="schoolExperience">
              <el-input
                v-model="educationFormData.school_experience"
                type="textarea"
                placeholder="请输入在校经历"
              ></el-input>
            </el-form-item>
          </el-form>
        </el-tab-pane>
        <el-tab-pane label="求职期望" name="fourth">
          <el-form :model="expectForm" ref="expectForm" label-position="top">
            <el-form-item label="求职类型" prop="type">
              <el-radio-group v-model="expectFormData.type">
                <el-radio :label="1">全职</el-radio>
                <el-radio :label="2">兼职</el-radio>
                <el-radio :label="3">实习生</el-radio>
              </el-radio-group>
            </el-form-item>
            <el-row>
              <el-col :span="10">
                <el-form-item label="期望职业标签" prop="job_tag">
                  <el-select
                    v-model="expectFormData.job_tag"
                    placeholder="请选择期望职业标签"
                  >
                    <el-option label="程序员" :value="1"></el-option>
                    <el-option label="公务员" :value="2"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="2"></el-col>
              <el-col :span="10">
                <el-form-item label="期望行业" prop="industry_id">
                  <el-select
                    v-model="expectFormData.industry_id"
                    placeholder="请选择期望职业标签"
                  >
                    <el-option label="it行业" :value="1"></el-option>
                    <el-option label="金融行业" :value="2"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="10">
                <el-form-item label="期望城市" prop="city">
                  <el-input
                    v-model="expectFormData.city"
                    placeholder="请选择期望城市"
                  ></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="2"></el-col>
              <el-col :span="10">
                <el-form-item label="其他城市" prop="other_city">
                  <el-input
                    v-model="expectFormData.other_city"
                    placeholder="请选择其他城市"
                  ></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="最低薪资（单位：K）" prop="min_salary">
                  <el-input-number
                    v-model="expectFormData.min_salary"
                    :min="1"
                    label="请选择最低薪资"
                  ></el-input-number>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="最高薪资（单位：K）" prop="max_salary">
                  <el-input-number
                    v-model="expectFormData.max_salary"
                    :min="1"
                    label="请选择最高薪资"
                  ></el-input-number>
                </el-form-item>
              </el-col>
            </el-row>
          </el-form>
        </el-tab-pane>
      </el-tabs>
    </el-dialog>
  </div>
</template>

<script setup lang="ts">
import { ref, reactive } from 'vue'

const dialogFormVisible = ref(false)

const activeName = ref('first')

const handleClick = () => {
  console.log('tab click')
}

let educationForm = ref()
const educationFormData = reactive({
  resume_id: null,
  school_name: '',
  type: 1,
  eduction: 1,
  major: '',
  enrollment_year: '',
  graduation_year: '',
  school_experience: '',
})

let expectForm = ref()
const expectFormData = reactive({
  resume_id: null,
  type: 1,
  job_tag: 1,
  city: '',
  other_city: '',
  min_salary: 1,
  max_salary: 1,
  industry_id: 1,
})
</script>
<style scoped lang="scss"></style>
